Skip to content

Remove leftover debug print(nb) in greedyROI_corr - #1591

Merged
pgunn merged 5 commits into
flatironinstitute:devfrom
zyyk78:remove-debug-print-nb
Oct 12, 2026
Merged

pgunn merged 5 commits into
flatironinstitute:devfrom
zyyk78:remove-debug-print-nb

Conversation

@zyyk78

@zyyk78 zyyk78 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Problem

greedyROI_corr() in caiman/source_extraction/cnmf/initialization.py contains a leftover bare print(nb) debug statement in the low-rank background estimation branch (nb > 0):

elif nb > 0:
    logger.info(f'Estimate low rank background (rank = {nb})')
    print(nb)
    if use_NMF:
        ...

Because greedyROI_corr is called once per initialization batch / per patch, this prints a bare integer (e.g. 1) for every call, polluting stdout in non-interactive runs and CI logs. The surrounding code already logs the same information via logger.info, so the print is redundant.

Fix

Remove the single print(nb) line. The logger.info call above it already communicates the rank.

Impact

  • Purely cosmetic: removes spurious stdout output; no functional change.
  • Safe to cherry-pick / backport to any release where the line is present.

Provenance

This print has been present since at least commit a9ad3e80 (2023-05-10, "fixed problem with sparse nmf initialization and updated notebook").

@pgunn

pgunn commented Oct 12, 2026

Copy link
Copy Markdown
Member

Good catch, thanks!

@pgunn
pgunn changed the base branch from main to dev October 12, 2026 21:02
@pgunn
pgunn merged commit ed8039f into flatironinstitute:dev Oct 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants